package com.ifdom.thread.safethread;

/**
 * @Author ifredomvip@gmail.com
 * @Date 2022/9/29 16:37
 * @Version 1.0.0
 * @Description
 **/
public class WhatSafaThread {

    // 0-30
    public static Integer count = 0;

    public static void main(String[] args) {
        Thread thread1 = new Thread(new ThreadS1());
        Thread thread2 = new Thread(new ThreadS1());
        Thread thread3 = new Thread(new ThreadS1());

        for (int i = 0; i < 10; i++) {
            thread1.start();
            getCount();
        }
    }
    public static void getCount() {
        count++;
        System.out.println("Runnable 执行");
    }

}

class ThreadS1 implements Runnable {

    @Override
    public void run() {
        System.out.println("Runnable 执行");
    }
}
